<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-education-add" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input id="eid" name="eid" class="form-control" type="hidden"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工号：</label>
                    <div class="col-sm-8">
                        <input id="badge" name="badge" placeholder="选择员工" class="form-control" type="text"
                               onclick="getEmp()" required />
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">姓名：</label>
                    <div class="col-sm-8">
                        <input id="name" name="name" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司名称：</label>
                    <div class="col-sm-8">
                        <input id="compName" name="compName" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">部门名称：</label>
                    <div class="col-sm-8">
                        <input id="depName" name="depName" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">岗位名称：</label>
                    <div class="col-sm-8">
                        <input id="jobName" name="jobName" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">新增信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否最高学历：</label>
                    <div class="col-sm-8">
                        <select name="ishigh" id="ishigh" class="form-control m-b">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select></div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">开始时间：</label>
                    <div class="col-sm-8">
                        <input id="BeginDate" name="BeginDate" class="form-control laydate-demo-1" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">结束时间：</label>
                    <div class="col-sm-8">
                        <input id="EndDate" name="EndDate" class="form-control laydate-demo-2" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学校名称：</label>
                    <div class="col-sm-8">
                        <input id="SchoolName" name="SchoolName" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">毕业类型：</label>
                    <div class="col-sm-8">
                        <select name="GradType" id="GradType" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_GradType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学习形式：</label>
                    <div class="col-sm-8">
                        <select name="StudyType" id="StudyType" class="form-control m-b"
                                th:with="type=${@dict.getType('ECD_STUDYTYPE')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学历类型：</label>
                    <div class="col-sm-8">
                        <select name="EduType" id="EduType" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_EduType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学位类型：</label>
                    <div class="col-sm-8">
                        <select name="DegreeType" id="DegreeType" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_DegreeType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">专业：</label>
                    <div class="col-sm-8">
                        <input id="Major" name="Major" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学历证书编号：</label>
                    <div class="col-sm-8">
                        <input id="EduNo" name="EduNo" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学历获得时间：</label>
                    <div class="col-sm-8">
                        <input id="EduNoDate" name="EduNoDate" class="form-control laydate-demo-3" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学位证书编号：</label>
                    <div class="col-sm-8">
                        <input id="DegreeNo" name="DegreeNo" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学位获得时间：</label>
                    <div class="col-sm-8">
                        <input id="DegreeNoDate" name="DegreeNoDate" class="form-control laydate-demo-4" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">学校地址：</label>
                    <div class="col-sm-8">
                        <input id="SchoolPlace" name="SchoolPlace" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证明人：</label>
                    <div class="col-sm-8">
                        <input id="Reference" name="Reference" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">联系方式：</label>
                    <div class="col-sm-8">
                        <input id="Tel" name="Tel" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否海外：</label>
                    <div class="col-sm-8">
                        <select name="isout" id="isout" class="form-control m-b">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select></div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "bgInfo/education";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-3',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-4',
                type: 'date'
            });
        });
    });

    function getEmp() {
        $.modal.open("选择添加教育经历人员", ctx + "bgInfo/getEmp");
    }

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-education-add").serializeArray();
            var eid = $("#eid").val();
            var badge = $("#badge").val();
            var name = $("#name").val();
            var ishigh = $("#ishigh").val();
            var BeginDate = $("#BeginDate").val();
            var EndDate = $("#EndDate").val();
            var SchoolName = $("#SchoolName").val();
            var GradType = $("#GradType").val();
            var StudyType = $("#StudyType").val();
            var EduType = $("#EduType").val();
            var DegreeType = $("#DegreeType").val();
            var Major = $("#Major").val();
            var EduNo = $("#EduNo").val();
            var EduNoDate = $("#EduNoDate").val();
            var DegreeNo = $("#DegreeNo").val();
            var DegreeNoDate = $("#DegreeNoDate").val();
            var SchoolPlace = $("#SchoolPlace").val();
            var Reference = $("#Reference").val();
            var Tel = $("#Tel").val();
            var isout = $("#isout").val();

            data.push({"name": "eid", "value": eid});
            data.push({"name": "badge", "value": badge});
            data.push({"name": "name", "value": name});
            data.push({"name": "ishigh", "value": ishigh});
            data.push({"name": "BeginDate", "value": BeginDate});
            data.push({"name": "EndDate", "value": EndDate});
            data.push({"name": "SchoolName", "value": SchoolName});
            data.push({"name": "GradType", "value": GradType});
            data.push({"name": "StudyType", "value": StudyType});
            data.push({"name": "EduType", "value": EduType});
            data.push({"name": "DegreeType", "value": DegreeType});
            data.push({"name": "Major", "value": Major});
            data.push({"name": "EduNo", "value": EduNo});
            data.push({"name": "EduNoDate", "value": EduNoDate});
            data.push({"name": "DegreeNo", "value": DegreeNo});
            data.push({"name": "DegreeNoDate", "value": DegreeNoDate});
            data.push({"name": "SchoolPlace", "value": SchoolPlace});
            data.push({"name": "Reference", "value": Reference});
            data.push({"name": "Tel", "value": Tel});
            data.push({"name": "isout", "value": isout});
            $.operate.save(prefix + "/add", data);
        }
    }

</script>
</body>
</html>
